<h2 class="pageTitle">Payroll</h2>

<form style="margin: 1em" action="{$data.root}?input=payroll" method="post">
    Period:
    <select size="1" name="period">
        {foreach from=$data.periods item="period" key="i"}
            <option {if $period==$data.today}selected="selected"{/if} value="{$period}">{$period}</option>
        {/foreach}
    </select>
    <input value="Show" type="submit" />
</form>

{if $data.show == 1}

    <h2 class="pageTitle">Payroll for {$data.selectedMonthName} {$data.selectedYear}</h2>

    <table class="list" style="width: auto">
        <tr>
            <td style="text-align: left; padding: 2px 5px;"><strong>Technic</strong</td>
            <td style="text-align: right; padding: 2px 5px;"><strong>Performance component</strong</td>
            <td style="text-align: right; padding: 2px 5px;"><strong>Responsibility component</strong</td>
        </tr>
        {foreach from=$data.users item="user"}
        <tr>
            <td style="text-align: left; padding: 2px 5px;">{$user.name} {$user.surname}</td>
            <td style="text-align: right; padding: 2px 5px;">{$user.first|round:"2"}</td>
            <td style="text-align: right; padding: 2px 5px;">{$user.second|round:"2"}</td>
        </tr>
        {/foreach}
    </table>

{/if}